﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 3.1
// Code is generated on: Wednesday, June 29, 2011 7:51:31 PM
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Data;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace MECPSDB.DatabaseSpecific
{
	/// <summary>Singleton implementation of the PersistenceInfoProvider. This class is the singleton wrapper through which the actual instance is retrieved.</summary>
	/// <remarks>It uses a single instance of an internal class. The access isn't marked with locks as the PersistenceInfoProviderBase class is threadsafe.</remarks>
	internal static class PersistenceInfoProviderSingleton
	{
		#region Class Member Declarations
		private static readonly IPersistenceInfoProvider _providerInstance = new PersistenceInfoProviderCore();
		#endregion

		/// <summary>Dummy static constructor to make sure threadsafe initialization is performed.</summary>
		static PersistenceInfoProviderSingleton()
		{
		}

		/// <summary>Gets the singleton instance of the PersistenceInfoProviderCore</summary>
		/// <returns>Instance of the PersistenceInfoProvider.</returns>
		public static IPersistenceInfoProvider GetInstance()
		{
			return _providerInstance;
		}
	}

	/// <summary>Actual implementation of the PersistenceInfoProvider. Used by singleton wrapper.</summary>
	internal class PersistenceInfoProviderCore : PersistenceInfoProviderBase
	{
		/// <summary>Initializes a new instance of the <see cref="PersistenceInfoProviderCore"/> class.</summary>
		internal PersistenceInfoProviderCore()
		{
			Init();
		}

		/// <summary>Method which initializes the internal datastores with the structure of hierarchical types.</summary>
		private void Init()
		{
			this.InitClass((9 + 0));
			InitMatbrandEntityMappings();
			InitMaterialEntityMappings();
			InitMatgroupEntityMappings();
			InitMatimgEntityMappings();
			InitMatumEntityMappings();
			InitSystemuserEntityMappings();
			InitVendorEntityMappings();
			InitVenptermEntityMappings();
			InitVwMaterialEntityMappings();

		}


		/// <summary>Inits MatbrandEntity's mappings</summary>
		private void InitMatbrandEntityMappings()
		{
			this.AddElementMapping( "MatbrandEntity", "MECPGDBDEV", @"public", "MATBRANDTBL", 4 );
			this.AddElementFieldMapping( "MatbrandEntity", "BrandCode", "BrandCode", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "MatbrandEntity", "BrandDescription", "BrandDescription", true, "Varchar", 50, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "MatbrandEntity", "LastModified", "LastModified", true, "Time", 0, 0, 0, false, "", null, typeof(System.DateTime), 2 );
			this.AddElementFieldMapping( "MatbrandEntity", "Rem", "Rem", true, "Text", 1073741824, 0, 0, false, "", null, typeof(System.String), 3 );
		}
		/// <summary>Inits MaterialEntity's mappings</summary>
		private void InitMaterialEntityMappings()
		{
			this.AddElementMapping( "MaterialEntity", "MECPGDBDEV", @"public", "MATERIALTBL", 13 );
			this.AddElementFieldMapping( "MaterialEntity", "AccountIdFk", "AccountIdFk", true, "Varchar", 50, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "MaterialEntity", "BrandCodeFk", "BrandCodeFK", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "MaterialEntity", "CritLevel", "CritLevel", false, "Real", 0, 0, 24, false, "", null, typeof(System.Single), 2 );
			this.AddElementFieldMapping( "MaterialEntity", "InActive", "InActive", false, "Boolean", 0, 0, 0, false, "", null, typeof(System.Boolean), 3 );
			this.AddElementFieldMapping( "MaterialEntity", "InvLevel", "InvLevel", false, "Real", 0, 0, 24, false, "", null, typeof(System.Single), 4 );
			this.AddElementFieldMapping( "MaterialEntity", "LastModified", "LastModified", false, "Timestamp", 0, 0, 0, false, "", null, typeof(System.DateTime), 5 );
			this.AddElementFieldMapping( "MaterialEntity", "MatDescription", "MatDescription", false, "Varchar", 80, 0, 0, false, "", null, typeof(System.String), 6 );
			this.AddElementFieldMapping( "MaterialEntity", "MaterialCode", "MaterialCode", false, "Varchar", 25, 0, 0, false, "", null, typeof(System.String), 7 );
			this.AddElementFieldMapping( "MaterialEntity", "MatGrpCodeFk", "MatGrpCodeFK", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 8 );
			this.AddElementFieldMapping( "MaterialEntity", "Remarks", "Remarks", true, "Text", 1073741824, 0, 0, false, "", null, typeof(System.String), 9 );
			this.AddElementFieldMapping( "MaterialEntity", "ReOrderLevel", "ReOrderLevel", false, "Real", 0, 0, 24, false, "", null, typeof(System.Single), 10 );
			this.AddElementFieldMapping( "MaterialEntity", "UmCodeFk", "UmCodeFK", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 11 );
			this.AddElementFieldMapping( "MaterialEntity", "WdserialNo", "WDSerialNo", false, "Boolean", 0, 0, 0, false, "", null, typeof(System.Boolean), 12 );
		}
		/// <summary>Inits MatgroupEntity's mappings</summary>
		private void InitMatgroupEntityMappings()
		{
			this.AddElementMapping( "MatgroupEntity", "MECPGDBDEV", @"public", "MATGROUPTBL", 4 );
			this.AddElementFieldMapping( "MatgroupEntity", "LastModified", "LastModified", true, "Timestamp", 0, 0, 0, false, "", null, typeof(System.DateTime), 0 );
			this.AddElementFieldMapping( "MatgroupEntity", "MatGrpCode", "MatGrpCode", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "MatgroupEntity", "MatGrpDescription", "MatGrpDescription", false, "Varchar", 50, 0, 0, false, "", null, typeof(System.String), 2 );
			this.AddElementFieldMapping( "MatgroupEntity", "Remarks", "Remarks", true, "Text", 1073741824, 0, 0, false, "", null, typeof(System.String), 3 );
		}
		/// <summary>Inits MatimgEntity's mappings</summary>
		private void InitMatimgEntityMappings()
		{
			this.AddElementMapping( "MatimgEntity", "MECPGDBDEV", @"public", "MATIMGTBL", 2 );
			this.AddElementFieldMapping( "MatimgEntity", "MatCode", "MatCode", false, "Varchar", 25, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "MatimgEntity", "MatImg", "MatImg", true, "Bytea", 1073741824, 0, 0, false, "", null, typeof(System.Byte[]), 1 );
		}
		/// <summary>Inits MatumEntity's mappings</summary>
		private void InitMatumEntityMappings()
		{
			this.AddElementMapping( "MatumEntity", "MECPGDBDEV", @"public", "MATUMTBL", 3 );
			this.AddElementFieldMapping( "MatumEntity", "Remarks", "Remarks", true, "Varchar", 50, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "MatumEntity", "UomCode", "UomCode", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "MatumEntity", "UomDescription", "UomDescription", false, "Varchar", 30, 0, 0, false, "", null, typeof(System.String), 2 );
		}
		/// <summary>Inits SystemuserEntity's mappings</summary>
		private void InitSystemuserEntityMappings()
		{
			this.AddElementMapping( "SystemuserEntity", "MECPGDBDEV", @"public", "SYSTEMUSERTBL", 5 );
			this.AddElementFieldMapping( "SystemuserEntity", "IsInactive", "IsInactive", false, "Boolean", 0, 0, 0, false, "", null, typeof(System.Boolean), 0 );
			this.AddElementFieldMapping( "SystemuserEntity", "Password", "Password", false, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "SystemuserEntity", "Rcpnl", "RCPNL", false, "Boolean", 0, 0, 0, false, "", null, typeof(System.Boolean), 2 );
			this.AddElementFieldMapping( "SystemuserEntity", "UserCode", "UserCode", false, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 3 );
			this.AddElementFieldMapping( "SystemuserEntity", "UserRole", "UserRole", false, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 4 );
		}
		/// <summary>Inits VendorEntity's mappings</summary>
		private void InitVendorEntityMappings()
		{
			this.AddElementMapping( "VendorEntity", "MECPGDBDEV", @"public", "VENDORTBL", 27 );
			this.AddElementFieldMapping( "VendorEntity", "AddressCity", "AddressCity", true, "Varchar", 30, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "VendorEntity", "AddressCountry", "AddressCountry", true, "Varchar", 30, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "VendorEntity", "AddressLine1", "AddressLine1", true, "Varchar", 30, 0, 0, false, "", null, typeof(System.String), 2 );
			this.AddElementFieldMapping( "VendorEntity", "AddressLine2", "AddressLine2", true, "Varchar", 30, 0, 0, false, "", null, typeof(System.String), 3 );
			this.AddElementFieldMapping( "VendorEntity", "AddressLine3", "AddressLine3", true, "Varchar", 30, 0, 0, false, "", null, typeof(System.String), 4 );
			this.AddElementFieldMapping( "VendorEntity", "CheckName", "CheckName", true, "Varchar", 80, 0, 0, false, "", null, typeof(System.String), 5 );
			this.AddElementFieldMapping( "VendorEntity", "CurrencyCodeFk", "CurrencyCodeFK", true, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 6 );
			this.AddElementFieldMapping( "VendorEntity", "EmailAddress", "EmailAddress", true, "Varchar", 40, 0, 0, false, "", null, typeof(System.String), 7 );
			this.AddElementFieldMapping( "VendorEntity", "FaxNo", "FaxNo", true, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 8 );
			this.AddElementFieldMapping( "VendorEntity", "MobileNo", "MobileNo", true, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 9 );
			this.AddElementFieldMapping( "VendorEntity", "Notes", "Notes", true, "Text", 1073741824, 0, 0, false, "", null, typeof(System.String), 10 );
			this.AddElementFieldMapping( "VendorEntity", "OnHold", "OnHold", false, "Boolean", 0, 0, 0, false, "", null, typeof(System.Boolean), 11 );
			this.AddElementFieldMapping( "VendorEntity", "PhoneNo1", "PhoneNo1", true, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 12 );
			this.AddElementFieldMapping( "VendorEntity", "PhoneNo2", "PhoneNo2", true, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 13 );
			this.AddElementFieldMapping( "VendorEntity", "PhoneNo3", "PhoneNo3", true, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 14 );
			this.AddElementFieldMapping( "VendorEntity", "PtermCodeFk", "PtermCodeFK", true, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 15 );
			this.AddElementFieldMapping( "VendorEntity", "ShortName", "ShortName", true, "Varchar", 80, 0, 0, false, "", null, typeof(System.String), 16 );
			this.AddElementFieldMapping( "VendorEntity", "Tin", "TIN", true, "Varchar", 25, 0, 0, false, "", null, typeof(System.String), 17 );
			this.AddElementFieldMapping( "VendorEntity", "Vatregistered", "VATRegistered", false, "Boolean", 0, 0, 0, false, "", null, typeof(System.Boolean), 18 );
			this.AddElementFieldMapping( "VendorEntity", "VendorContractPerson", "VendorContractPerson", true, "Varchar", 40, 0, 0, false, "", null, typeof(System.String), 19 );
			this.AddElementFieldMapping( "VendorEntity", "VendorContractPosition", "VendorContractPosition", true, "Varchar", 40, 0, 0, false, "", null, typeof(System.String), 20 );
			this.AddElementFieldMapping( "VendorEntity", "VendorId", "VendorId", false, "Varchar", 15, 0, 0, false, "", null, typeof(System.String), 21 );
			this.AddElementFieldMapping( "VendorEntity", "VendorName", "VendorName", false, "Varchar", 80, 0, 0, false, "", null, typeof(System.String), 22 );
			this.AddElementFieldMapping( "VendorEntity", "VendorStatusCodeFk", "VendorStatusCodeFK", true, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 23 );
			this.AddElementFieldMapping( "VendorEntity", "VendorTypeCodeFk", "VendorTypeCodeFK", true, "Varchar", 20, 0, 0, false, "", null, typeof(System.String), 24 );
			this.AddElementFieldMapping( "VendorEntity", "Website", "Website", true, "Varchar", 50, 0, 0, false, "", null, typeof(System.String), 25 );
			this.AddElementFieldMapping( "VendorEntity", "ZipCode", "ZipCode", true, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 26 );
		}
		/// <summary>Inits VenptermEntity's mappings</summary>
		private void InitVenptermEntityMappings()
		{
			this.AddElementMapping( "VenptermEntity", "MECPGDBDEV", @"public", "VENPTERMTBL", 2 );
			this.AddElementFieldMapping( "VenptermEntity", "PtermCode", "PtermCode", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "VenptermEntity", "PtermDescription", "PtermDescription", false, "Varchar", 50, 0, 0, false, "", null, typeof(System.String), 1 );
		}
		/// <summary>Inits VwMaterialEntity's mappings</summary>
		private void InitVwMaterialEntityMappings()
		{
			this.AddElementMapping( "VwMaterialEntity", "MECPGDBDEV", @"public", "VwMaterial", 15 );
			this.AddElementFieldMapping( "VwMaterialEntity", "BrandCodeFk", "BrandCodeFK", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 0 );
			this.AddElementFieldMapping( "VwMaterialEntity", "BrandDescription", "BrandDescription", false, "Varchar", 50, 0, 0, false, "", null, typeof(System.String), 1 );
			this.AddElementFieldMapping( "VwMaterialEntity", "CritLevel", "CritLevel", false, "Real", 0, 0, 24, false, "", null, typeof(System.Single), 2 );
			this.AddElementFieldMapping( "VwMaterialEntity", "InActive", "InActive", false, "Boolean", 0, 0, 0, false, "", null, typeof(System.Boolean), 3 );
			this.AddElementFieldMapping( "VwMaterialEntity", "InvLevel", "InvLevel", false, "Real", 0, 0, 24, false, "", null, typeof(System.Single), 4 );
			this.AddElementFieldMapping( "VwMaterialEntity", "LastModified", "LastModified", false, "Timestamp", 0, 0, 0, false, "", null, typeof(System.DateTime), 5 );
			this.AddElementFieldMapping( "VwMaterialEntity", "MatDescription", "MatDescription", false, "Varchar", 80, 0, 0, false, "", null, typeof(System.String), 6 );
			this.AddElementFieldMapping( "VwMaterialEntity", "MaterialCode", "MaterialCode", false, "Varchar", 25, 0, 0, false, "", null, typeof(System.String), 7 );
			this.AddElementFieldMapping( "VwMaterialEntity", "MatGrpCodeFk", "MatGrpCodeFK", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 8 );
			this.AddElementFieldMapping( "VwMaterialEntity", "MatGrpDescription", "MatGrpDescription", false, "Varchar", 50, 0, 0, false, "", null, typeof(System.String), 9 );
			this.AddElementFieldMapping( "VwMaterialEntity", "Remarks", "Remarks", false, "Text", 1073741824, 0, 0, false, "", null, typeof(System.String), 10 );
			this.AddElementFieldMapping( "VwMaterialEntity", "ReOrderLevel", "ReOrderLevel", false, "Real", 0, 0, 24, false, "", null, typeof(System.Single), 11 );
			this.AddElementFieldMapping( "VwMaterialEntity", "UmCodeFk", "UmCodeFK", false, "Varchar", 10, 0, 0, false, "", null, typeof(System.String), 12 );
			this.AddElementFieldMapping( "VwMaterialEntity", "UomDescription", "UomDescription", false, "Varchar", 30, 0, 0, false, "", null, typeof(System.String), 13 );
			this.AddElementFieldMapping( "VwMaterialEntity", "WdserialNo", "WDSerialNo", false, "Boolean", 0, 0, 0, false, "", null, typeof(System.Boolean), 14 );
		}

	}
}